<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1></h1>
    <script>
        let h=document.querySelector("h1");
        function fun(){
            let data=new Date();
            let shi=data.getHours();
            let fen=data.getMinutes();
            let miao=data.getSeconds();
            h.innerHTML=`${shi}:${fen}:${miao}`
            setTimeout(()=>{
                fun()
            },1000)
        }
        fun()
    </script>
</body>
</html>